// Proxy 对比 Object.defineProperty()

// const person = {
//     name: 'zce',
//     age: 20
// }

// const personProxy = new Proxy(person, {
//     deleteProperty(target, property) {
//         console.log('delete', property)
//         delete target[property]
//     }
// })

// delete personProxy.age
// console.log(person)

// 监视数组对象
const list = []
const listProxy = new Proxy(list, {
    set(target, property, value) {
        console.log('set', property, value)
        target[property] = value
        return true
    }
})


listProxy.push(100)
listProxy.push(100)